﻿<!--PC INpact Toolkit for Chrome™

	PC INpact Toolkit for Chrome™ est une extension destinée au navigateur Chrome permettant d'accéder à de nombreuses fonctionnalités de PC INpact.
	Vous y retrouverez les actualités, brèves, calendriers du site, mais aussi les comptes Twitter de l'équipe ou des fonctionnalités de recherche.
	Des notifications peuvent aussi être affichées sur votre bureau, à chaque nouvelle publication sur le site (actualités, dossiers, tests).

	Main author : LEGRAND David
	Mail : david@pcinpact.com
	
	Google Code Project : http://pci.im/code-pci-chrome 
	Forum : http://pci.im/forum-pci-chrome
	
    This file is part of PC INpact Toolkit for Chrome™.

    PC INpact Toolkit for Chrome™ is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    PC INpact Toolkit for Chrome™ is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with PC INpact Toolkit for Chrome™.  If not, see <http://www.gnu.org/licenses/>. 
 
	Loading GIF : http://www.ajaxload.info/
	-->

<html>
    <head>
		<!-- On intègre l'ensemble des scripts -->
		<script type="text/javascript" src="/js/main.js"></script>
		<script type="text/javascript" src="/js/notify.js"></script>
		<script type="text/javascript" src="/js/rss.js"></script>
		<script type="text/javascript" src="/js/forum.js"></script>
		<script type="text/javascript" src="/js/breves.js"></script>
		<script type="text/javascript" src="/js/omni.js"></script>
		
		<script>
		
            function init() {

				// On lance la fonction qui écoute l'Omnibox
				omni_listen();
				
				// On gère le cas du changement de valeur pour notif_check
				if (localStorage["notif_ckeck"] != 0 && localStorage["notif_ckeck"] != 1) localStorage["notif_ckeck"] = 1;
				
				// On gère les valeurs par défaut des options
				if (!localStorage["notif_delay"]) localStorage["notif_delay"] = 15;
				if (!localStorage["cache_delay"]) localStorage["cache_delay"] = 5;
				
				if (!localStorage["notif_ckeck"]) localStorage["notif_ckeck"] = 1;
				if (!localStorage["popup_check"]) localStorage["popup_check"] = 0;
				if (!localStorage["actus_redir_check"]) localStorage["actus_redir_check"] = 1;
				
				if (!localStorage["news_delay"]) localStorage["news_delay"] = 5;
				if (!localStorage["breves_delay"]) localStorage["breves_delay"] = 5;
				if (!localStorage["articles_delay"]) localStorage["articles_delay"] = 15;
				if (!localStorage["forum_delay"]) localStorage["forum_delay"] = 5;
				
				// On check une première fois les flux RSS
				check_rss('news.xml', 'news', 34);
				check_rss('articles.xml', 'articles', 24);
				
				// On check une première fois les brèves 
				check_breves();
				
				// On check une première fois les infos du forum
				get_forum_infos();
				
				// Puis on recommence toutes les X minutes
				var interval_news = localStorage["news_delay"] * 60 * 1000;
				var timer_news = setInterval("check_rss('news.xml', 'news', 34)", interval_news);
				
				var interval_breves = localStorage["breves_delay"] * 60 * 1000;
				var timer_breves = setInterval("check_breves()", interval_breves);
				
				var interval_articles = localStorage["articles_delay"] * 60 * 1000;
				var timer_articles = setInterval("check_rss('articles.xml', 'articles', 24)", interval_articles);
				
				var interval_forum = localStorage["forum_delay"] * 60 * 1000;
				var timer_forum = setInterval("get_forum_infos()", interval_forum);
				
            }
        </script>
    </head>
    <body onload="init()">
    </body>
</html>